﻿@using X.Scaffolding.Core
@using PagedList.Mvc;
@model PagedList.IPagedList<DanceIntegration.Models.EditUserViewModel>

@{
    ViewBag.Title = "Список логинов";
}

<h2>@ViewBag.Title</h2>

<p>
    @Html.ActionLink("Создать", "Create", null, new { @class = "btn btn-success create" })
</p>
<table class="table table-hover">
    <tr>
        <th>UserName</th>
        <th>CanLogin</th>
        <th class="controls-head"></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.UserName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.CanLogin)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ID }, new { @class = "btn btn-xs btn-info edit" }) 
            @Html.ActionLink("Delete", "Delete", new { id=item.ID }, new { @class = "btn btn-xs btn-danger delete" })
        </td>
    </tr>
}

</table>


Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of @Model.PageCount
@Html.PagedListPager(Model, page => Url.Action("PagedIndex", new { page, sortOrder = ViewBag.CurrentSort, currentFilter = ViewBag.CurrentFilter }))